package com.chengda.dashboard.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chengda.dashboard.entity.FactoryMachineInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 工厂机台信息Mapper接口
 */
@Mapper
public interface FactoryMachineInfoMapper extends BaseMapper<FactoryMachineInfo> {

    /**
     * 根据类型统计机台总数
     * @param type 类型
     * @return 机台总数
     */
    @Select("SELECT COUNT(*) FROM factory_machine_info WHERE machine_type = #{type}")
    Integer countByType(@Param("type") Integer type);
}
